<?php
/**
 * Created by PhpStorm.
 * User: shkj
 * Date: 2020/5/8
 * Time: 16:53
 */

namespace app\api\controller\v1;
use think\Db;
use think\facade\Log;
use think\facade\Request;
use app\api\model\Order;
use Alipay\aop\AopClient;
use app\api\service\Order as OrderService;
class pay extends Base
{
  public function order(){
      $data = Request::post();
 
      $uid = $data['uid'];

      $token = Request()->header('token');
      $status = $this->verifyToken($uid,$token);
      
        // die;
        if($token && $status){
          $order = new OrderService();
        $status = $order->place($uid,$data['goods'],$data['coupons_id']);
        return $status;
        }else{
            return_json(40001,'token过期了');
        }

  }

  public function vali(){
    $data = Request::post();
    
    $token = Request()->header('token');
    $status = $this->verifyToken($data['uid'],$token);
    
      if($token && $status){
            $status = model('user')->vali($data);
            return $status;
        }else{
            return_json(40001,'token过期了',40001);
        }

  }

 



}